import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

import HomePage from '../components/HomePage.vue'
import ReleasePage from '../components/ReleasePage.vue'
import MyPage from '../components/MyPage.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: 'home',
		redirect: '/home',
		component: HomeView,
		children: [{
				path: 'home',
				component: HomePage
			},
			{
				path: 'release',
				component: ReleasePage
			},
			{
				path: 'my',
				component: MyPage
			}
		]
	},
	{
		path: '/about',
		name: 'about',
		component: () => import('../views/AboutView.vue')
	},
	{
		path: '/user',
		name: 'user',
		component: () => import('../views/UserView.vue')
	},
	{
		path: '/search',
		name: 'search',
		component: () => import('../views/SearchView.vue')
	},
	{
		path: '/log',
		name: 'log',
		component: () => import('../views/LogView.vue')
	},
	{
		path: '/reg',
		name: 'reg',
		component: () => import('../views/RegView.vue')
	},
	{
		path: '/forget',
		name: 'forget',
		component: () => import('../views/ForgetView.vue')
	},
	{
		path: '/article',
		name: 'article',
		component: () => import('../views/ArticleView.vue')
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
